package com.hz.house.dao;

import com.hz.house.bean.entity.*;
import com.hz.house.bean.es.SellManEsDocumentBean;
import com.hz.house.bean.vo.*;
import com.hz.house.bean.vo.building.Building;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface SellManMapper {

	List<SellManCachedBasicInfoBean> getSellMan(@Param("customerId")String customerId);
	
	int batchAddVisits(List<SimpleCountBean> vs);
	
	int batchAddAskCounts(List<SimpleCountBean> vs);
	
	int batchAddPaiseCounts(List<SimpleCountBean> vs);
	
	List<SellManHuoYueDu> getYesterdayStarHuoYueDu(@Param("yesterDayDate") int yesterDayDate, @Param("buildingId") Integer buildingId);
	
	List<SellManYesterdayStar> getYesterDayStarInfo(List<SellManHuoYueDu> hyd);
	
	List<Integer> getAllSellManCustomerId() throws Exception;
	
	SellManSignBean getSellManSignInfo(@Param("sellManCustomerId")int sellManCustomerId);
	
	int updateLastOpenBox7Time(SellManSignBean sign);
	
	int addSellManSignRecord(SellManSignRecordBean record);
	
	int updateSellManSign(SellManSignBean sign);

	int exchangeBuilding(@Param("buildingId") Integer buildingId, @Param("twoBuildingId") Integer twoBuildingId, @Param("customerId") Integer customerId);
	
	int updateSellManSeriesSign(@Param("nowDate")int nowDate) throws Exception;
	
	Integer sellManTodayIsSign(@Param("sellManCustomerId")int sellManCustomerId);
	
	int sellManIsFocusWxgzh(@Param("sellManCustomerId")int sellManCustomerId,@Param("scoreId")int scoreId);
	
	int getSellManTodayOldTimes(@Param("sellManCustomerId")int sellManCustomerId,@Param("nowDate")int nowDate);
	
	int getSellManInviteNewUserToday(@Param("sellManCustomerId")int sellManCustomerId,
			@Param("nowDate")int nowDate);
	
	int  addSellManPraiseRecord(SellManPraiseBean smp) throws Exception;
	
	int isTodayPraiseSellMan(@Param("customerId")int customerId,
			@Param("sellManCustomerId")int sellManCustomerId,@Param("nowDate")int nowDate);
	
	List<SellManEsDocumentBean> getSellManSynInfo(List<Integer> ids);
	
	int addSellManFocus(SellManFocusBean smf) throws Exception;
	
	int deleteSellManFocus(SellManFocusBean smf);
	
	int getSignSeriesDays(@Param("sellManCustomerId")int sellManCustomerId);
	
	List<SellManTotalScoreAndLive> getTotalScoreAndTodayScore(@Param("nowDate")int nowDate,@Param("customerId")int customerId);
	
	Integer getLast30DaysTotalScore(@Param("customerId")int customerId,@Param("limitDate")int limitDate);
	
	List<SellManDailyScoreBean> getMonthDailyScore(Map<String,Object> m);

	List<SellManScoreRecord> getDailyScoreRecord(Map<String,Object> m);
	int getDailyScoreRecordTotal(Map<String,Object> m);
	
	List<SellManDailyScoreBean> getLast30DailyScore(@Param("customerId")int customerId,@Param("stDate")int stDate);
	
	int getNotReadMsgCount(@Param("customerId")int customerId);
	
	Integer getSellManRemainScore(@Param("sellManCustomerId")int sellManCustomerId);
	
	int addCoinRecord(SellManCoinRecordBean r) throws Exception;
	
	int addCoin(SellManCoinBean r) throws Exception;
	
	int minusCoin(@Param("sellManCustomerId")int sellManCustionId,@Param("coin")int coin)throws Exception;
	
	int minusScore(@Param("sellManCustomerId")int sellManCustionId,@Param("score")int score)throws Exception;
	
	int addMinusScoreRecord(SellmanScoreConsumeRecord r) throws Exception;
	
	SellManCoinAndRemainScore getSellManScoreAndCoin(@Param("sellManCustomerId")int sellManCustomerId);
	
	List<SellManCoinRecordBean> getCoinRerods(@Param("page")Integer page,@Param("sellManCustomerId")int sellManCustomerId );
	int getCoinRerodsTotal(@Param("sellManCustomerId")int sellManCustomerId );
	
	Integer getSellManCoinBalance(@Param("sellManCustomerId")Integer sellManCustomerId);
	
	int doChuJia(SellManHomePageRecordBean x);
	
	Integer getSellManTopCoinNow(@Param("homeDate")String homeDate);
	
	List<SellManHomePageRecordBean> getTodayChuJiaList(@Param("homeDate")String homeDate,@Param("page")int page);
	Integer getTodayChuJiaListTotal(@Param("homeDate")String homeDate);
	
	SellManHomePageRecordBean getMaxCoinToday(@Param("homeDate")String homeDate,@Param("maxCoin")int maxCoin);
	
	int updateHomePageRecordSuccess(@Param("homeDate")String homeDate,@Param("sellManCustomerId")int sellManCustomerId);
	
	int updateUserBaseInfo(List<UserBaseInfo> infos);

	List<Building> getBuildingById(@Param("buildIds") String buildIds);

	void editSellManGreet(@Param("customerId") Integer customerId, @Param("greet") String greet);

}
